/* 样式表：styles.css */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: rgba(220, 239, 254);
    text-align: center;
}

/* body img {
    margin-left: 120px;
} */

body a {
    text-decoration: none;
    color: black;
}

body a:hover {
    color: rgba(136, 119, 206);
}

div img {
    float: left;
    margin-right: 10px;
    /* 根据需要调整右边距 */
    width: auto;
    /* 根据需要调整图片宽度 */
    height: auto;
}

.header-container {
    background-color: rgba(243, 245, 248);
    color: black;
    padding: 15px;
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 24px;
}

nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
}

nav ul li {
    margin: 0 10px;
}

nav ul li a {
    color: black;
    text-decoration: none;
}

nav ul li a:hover {
    text-decoration: underline;
}

main {
    background-color: rgba(220, 239, 254);
    display: flex;
    padding: 20px;
}

main .content {
    margin-left: 100px;
}

main .sidebar {
    margin-left: 20px;
    margin-right: 300px;
}

.sidebar a {
    display: block;
    width: 200px;
    height: 40px;
    background-color: rgba(246, 247, 251);
    font-size: 14px;
    color: rgba(153, 153, 153);
    text-decoration: none;
    padding-left: 0px;
    line-height: 40px;
}

.sidebar a:hover {
    background-color: rgba(73, 170, 238);
}

.main-nav {
    width: 100%;
    background-color: #fff;
    padding: 15px;
    margin-bottom: 20px;
    /* 增加底部间距 */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.main-nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: space-around;
    /* 使导航项均匀分布 */
}

.main-nav ul li {
    margin-bottom: 10px;
}

.main-nav ul li a {
    color: #333;
    text-decoration: none;
}

.main-nav ul li a:hover {
    text-decoration: underline;
}

section {
    background-color: rgba(255, 255, 255);
}

section:hover {
    background-color: rgba(247, 249, 252);
}

.sidebar {
    width: 200px;
    background-color: #fff;
    padding: 15px;
    margin-right: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar h2 {
    font-size: 18px;
}

.sidebar ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li {
    margin-bottom: 10px;
}

.sidebar ul li a {
    color: #333;
    text-decoration: none;
}

.sidebar ul li a:hover {
    text-decoration: underline;
}

.content {
    flex-grow: 1;
    background-color: #fff;
    padding: 15px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.content h2 {
    font-size: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.content h4 {
    text-align: left;
}

.post {
    margin-bottom: 20px;
    width: 900px;
    /* 固定宽度 */
    height: 200px;
    /* 固定高度 */
    padding: 15px;
    /* 内间距 */
    box-sizing: border-box;
    /* 包括内间距和边框在内 */
    background-color: #f9f9f9;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    /* 内容溢出隐藏 */
}

.post h3 {
    font-size: 18px;
    margin: 0;
}

.post p {
    margin: 10px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    /* 文字溢出省略号 */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* 显示的行数 */
    -webkit-box-orient: vertical;
}

.post a {
    color: #0066cc;
    text-decoration: none;
}

.post a:hover {
    text-decoration: underline;
}

body h4 {
    text-align: left;
}